Telegram Group & Telegram Channel
Calculates the date of n days ago from today.

Use datetime.date.today() to get the current day.

Use datetime.timedelta to subtract n days from today's date.


Code:


from datetime import timedelta, date

def days_ago(n):
return date.today() - timedelta(n)

EXAMPLE

days_ago(5)

Output:
date(2020, 10, 23)

Share and Support
@Python_Codes



tg-me.com/python_codes/147
Create:
Last Update:

Calculates the date of n days ago from today.

Use datetime.date.today() to get the current day.

Use datetime.timedelta to subtract n days from today's date.


Code:


from datetime import timedelta, date

def days_ago(n):
return date.today() - timedelta(n)

EXAMPLE

days_ago(5)

Output:
date(2020, 10, 23)

Share and Support
@Python_Codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/147

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Python Codes from ar


Telegram Python Codes
FROM USA